selext:
SQL> SELECT * FROM EMPLOYEE
SQL> SELECT * FROM EMPLOYEE WHERE EMPNO = 213
SQL> SELECT * FROM EMPLOYEE WHERE JOB = 'Clrk'  where clause with qualifier ORDER BY EMPNO; 
SQL> SELECT * FROM EMPLOYEE WHERE JOB = 'Clrk'  where clause with qualifier ORDER BY EMPNO desc

1- Write a SQL query that will return information about all managers in the EMPLOYEE table, 
   ordered alphabetically by name. 
2- Write a SQL query that will return information about all employees in Department 40,
   ordered by employee number. 
3- Write a SQL query that will return information about all employees that are female,
   ordered alphabetically by name
4- Write a SQL query that will return the employee number and name of all clerks, 
   ordered by employee number. 
5- Write a SQL query that will return the name and job of all employees who are male, 
   ordered alphabetically by name

USING DISTINCT:

DISTINCT means unique. Using DISTINCT will filter out duplicates from your results table. 
In the EMPLOYEE table the JOB field is populated for each employee. If you wanted 
a list of all the individual job titles without any repeating rows you would use 
DISTINCT to filter out the duplicates.

SQL>SELECT DISTINCT JOB FROM EMPLOYEE; 

SQL> SELECT DISTINCT JOB FROM EMPLOYEE; 

what is the diffrences between above statment.

1-Write a SQL query that will return all the unique department numbers that are 
  represented in the EMPLOYEE table, ordered by department number. 


LOGICAL OPERATORS: AND and OR:

SQL>SELECT NAME, JOB, SEX FROM EMPLOYEE WHERE JOB = 'Mngr' AND SEX = 'F'

SQL> SELECT NAME, JOB, SEX FROM EMPLOYEE WHERE JOB = 'Mngr' OR SEX = 'F'

the following query wants to know the employee number and name for anyone in
the EMPLOYEE table  who is a manager and all the clerks working in department 50:

SQL> SELECT EMPNO, NAME, JOB, DEPTNO FROM EMPLOYEE WHERE JOB = 'Mngr' OR (JOB = 'Clrk' AND DEPTNO = 50);

This query is asking for the employee number and name of anyone who is a manager or 
a clerk working in department 50.
 
SQL> SELECT EMPNO, NAME FROM EMPLOYEE WHERE (JOB = 'Mngr' OR JOB = 'Clrk') AND DEPTNO = 50;


1- Write a SQL query to return the employee number, name and salary of all females who work in Department 10. 
2- Write a SQL query to return the employee number, name and salary of all male managers, ordered alphabetically by name. 
3- Write a SQL query to return the name and job of all salesmen and managers who are female. 



CONDITIONAL OPERATORS :
Secondly, with the IN operator. The IN operator allows you to specify a list of values. When one of those values is true the row will be returned to the results table. The SQL implementation for using the IN operator is below:

SQL> SELECT NAME, EMPNO FROM EMPLOYEE WHERE JOB IN ('Slsm','Clrk');

NOT IN:

SQL> SELECT NAME, EMPNO FROM EMPLOYEE WHERE JOB NOT IN ('Slsm','Clrk'); 


NOT EQUAL :

SQL> SELECT NAME, EMPNO FROM EMPLOYEE WHERE JOB != 'Slsm' AND JOB <> 'Clrk'; 

BETWEEN :

SQL> SELECT NAME, SALARY FROM EMPLOYEE WHERE SALARY BETWEEN 825 AND 2300
SQL> SELECT NAME, SALARY FROM EMPLOYEE WHERE SALARY >= 825 AND SALARY <= 2300

LIKE, NOT LIKE:

SQL> SELECT EMPNO, NAME FROM EMPLOYEE WHERE NAME LIKE 'R%';

SQL> SELECT EMPNO, NAME FROM EMPLOYEE WHERE NAME LIKE 'Wi%';

SQL> SELECT EMPNO, NAME FROM EMPLOYEE WHERE NAME LIKE '%u%e%'; 
SQL> SELECT EMPNO, NAME FROM EMPLOYEE WHERE NAME LIKE '___i%';



IS NULL, IS NOT NULL :

SQL> SELECT <column_name> FROM <table_name> WHERE <column_name> IS NULL;

SQL> SELECT NAME FROM EMPLOYEE WHERE COMM IS NOT NULL AND COMM > 0;




1- Write a SQL query to find employee number, name and job of all females who are not managers. 
2- Write a SQL query to find employee number, name and salary of all employees who make less than $1000 or more than $4000, ordered by salary. 
3- Write a SQL query to find the name and employee number of all salesmen whose name begins with the letter S. 
   Use the IN operator to write a SQL query to find the name and employee number of all employees who are analysts or managers, ordered alphabetically by name. 
4- Write a SQL query to find the employee number, name, salary and commision of all employees who have been paid commission and whose salary is greater than $4000.


ARITHMETIC OPERATORS: +, -, /, *:

SQL> SELECT <column_name> <math operator> <value or column_name> FROM <table_name>;

SQL> SELECT NAME, SALARY, COMM, SALARY + COMM FROM EMPLOYEE; 

SQL> SELECT NAME, SALARY * 12  multiply operator on a column FROM EMPLOYEE; 


Again, consider that the value in the Salary column is a monthly figure. Suppose that you as the owner of this company want to compute how much each employee would be paid per month 
if you gave everyone a 3% pay cut. Write a SQL query to get this information.









 

 







